#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
import subprocess

"""
child = subprocess.Popen("dir", shell=True,
                         stdout=subprocess.PIPE,
                         stderr=subprocess.PIPE)

print(child.stdout.read().decode("gbk"))
"""

# child =subprocess.Popen(["arp"], stdin=subprocess.PIPE)
# child.communicate("-a")
# child = subprocess.Popen(["arp"], stdin=subprocess.PIPE)
# child.communicate('-v'.encode("gbk"))

# p1=subprocess.Popen("cat file.txt", shell=True, stdout=subprocess.PIPE)
# p2 = subprocess.Popen("tail -2", shell=True, stdin=p1.stdout, stdout=subprocess.PIPE)
# print(p2.stdout)
# print(p2.stdout.read().decode("utf-8"))
#
# s = subprocess.getstatusoutput("/opt/drs/ccu/release/linux/bin/ccu.server status")
# print(s)


command = input(">>>: ").strip()
c = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE)
print(c.stdout.read().decode("utf-8"))







